package com.spa.infrastructure.enums.dict.carousel;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.spa.infrastructure.annotation.SysDictEnumAnnotation;
import com.spa.infrastructure.enums.dict.IBaseEnum;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @description: 轮播图类型
 *
 * @author: lig
 * @date: 2024/3/4
 */
@Getter
@AllArgsConstructor
@SysDictEnumAnnotation(key = "carouselType", desc = "轮播图类型")
@JsonFormat(shape = JsonFormat.Shape.OBJECT)
public enum CarouselTypeEnum implements IBaseEnum {

    $0(0, "用户端",1,0),
    $1(1, "技师端",2,0),
    ;

    private final Integer code;
    private final String desc;
    //排序
    private final Integer sort;
    //状态  0 启用  1 不启用
    private final Integer status;

    public static CarouselTypeEnum byCode(int code) {
        for (CarouselTypeEnum value : values()) {
            if (value.code == code) return value;
        }
        return null;
    }

}
